paned: Use gtk_widget_measure to measure widget sizes
authorTimm Bäder <mail@baedert.org>
Fri, 17 Feb 2017 16:46:47 +0000 (17:46 +0100)
committerTimm Bäder <mail@baedert.org>
Fri, 17 Feb 2017 17:23:10 +0000 (18:23 +0100)
gtk/gtkpaned.c

index 13edfd4c7418cba45018e64dca5198c34dce9ea4..23938478648eeb9cd8beef82b5db727d143f98b9 100644 (file)
@@ -1285,12 +1285,12 @@ gtk_paned_allocate (GtkCssGadget        *gadget,
         {
           gint child1_width, child2_width;
 
-          gtk_widget_get_preferred_width_for_height (priv->child1,
-                                                     allocation->height,
-                                                     &child1_width, NULL);
-          gtk_widget_get_preferred_width_for_height (priv->child2,
-                                                     allocation->height,
-                                                     &child2_width, NULL);
+          gtk_widget_measure (priv->child1, GTK_ORIENTATION_HORIZONTAL,
+                              allocation->height,
+                              &child1_width, NULL, NULL, NULL);
+          gtk_widget_measure (priv->child2, GTK_ORIENTATION_HORIZONTAL,
+                              allocation->height,
+                              &child2_width, NULL, NULL, NULL);
 
           gtk_paned_calc_position (paned,
                                    MAX (1, allocation->width - handle_size),
@@ -1341,12 +1341,12 @@ gtk_paned_allocate (GtkCssGadget        *gadget,
         {
           gint child1_height, child2_height;
 
-          gtk_widget_get_preferred_height_for_width (priv->child1,
-                                                     allocation->width,
-                                                     &child1_height, NULL);
-          gtk_widget_get_preferred_height_for_width (priv->child2,
-                                                     allocation->width,
-                                                     &child2_height, NULL);
+          gtk_widget_measure (priv->child1, GTK_ORIENTATION_VERTICAL,
+                              allocation->width,
+                              &child1_height, NULL, NULL, NULL);
+          gtk_widget_measure (priv->child2, GTK_ORIENTATION_VERTICAL,
+                              allocation->width,
+                              &child2_height, NULL, NULL, NULL);
 
           gtk_paned_calc_position (paned,
                                    MAX (1, allocation->height - handle_size),